using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using DevExpress.XtraReports.UI;

namespace WindowsFormsApplication1
{
    public partial class rptThongtinveSV : DevExpress.XtraReports.UI.XtraReport
    {
        public rptThongtinveSV()
        {
            InitializeComponent();
        }

        public void BindData(string SoQDKL, string NgayKL, string HinhthucKL, string LydoKL)
        {
            colHoten.DataBindings.Add("Text", DataSource, "Hoten");
            colMasv.DataBindings.Add("Text", DataSource, "MasvID");
            colNgaysinh.DataBindings.Add("Text", DataSource, "Ngaysinh", "{0:MM/dd/yyyy}");
            colNoisinh.DataBindings.Add("Text", DataSource, "Noisinh");
            colNganhhoc.DataBindings.Add("Text", DataSource, "Tennganh");
            colMalop.DataBindings.Add("Text", DataSource, "MalopID");
            colNamvaohoc.DataBindings.Add("Text", DataSource, "Namvaohoc");
            colDiachi.DataBindings.Add("Text", DataSource, "Diachi");

            if (SoQDKL == "" && NgayKL == "" && HinhthucKL == "" && LydoKL == "")
            {
                xrTable2.Visible = false;
            }
            else {
                xrTable2.Visible = true;
                colSoQDKL.Text = SoQDKL;
                colNgayraQD.Text = NgayKL;
                colHinhthucKL.Text = HinhthucKL;
                colLydo.Text = LydoKL;
            }
           
        }

        private void colSoQDKL_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
        {
            //if (colSoQDKL.Text == "")
            //    
            //else
            //    xrTable2.Visible = true;
        }

        private void colMasv_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
        {
            //if (colSoQDKL.Text == "")
            //    xrTable2.Visible = false;
            //else
            //    xrTable2.Visible = true;
        }

    }
}
